import { BrowserModule } from '@angular/platform-browser';
// 双向绑定
import { NgModule } from '@angular/core';
// 响应拦截器
import {NoopInterceptor} from './intercepter';
import { HTTP_INTERCEPTORS } from '@angular/common/http';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { LayoutComponent } from './layout/layout.component';
import { ContactEditComponent } from './contact-edit/contact-edit.component';
import { ContactListComponent } from './contact-list/contact-list.component';
import { ContactNewComponent } from './contact-new/contact-new.component';
import { SigninComponent } from './signin/signin.component';
import { SignupComponent } from './signup/signup.component';
import { TagNewComponent } from './tag-new/tag-new.component';
import { TagListComponent } from './tag-list/tag-list.component';
import { TagEditComponent } from './tag-edit/tag-edit.component';

import {FormBuilder, FormsModule, ReactiveFormsModule , } from '@angular/forms';

import {NzTableModule} from 'ng-zorro-antd/table';
import { NzSelectModule } from 'ng-zorro-antd/select';
import {NzResizableModule} from 'ng-zorro-antd/resizable';
import { HeroFormComponent } from './hero-form/hero-form.component';
import { HttpClientModule } from '@angular/common/http';
import { TableComponent } from './table/table.component';
import { NZ_I18N } from 'ng-zorro-antd/i18n';
import { zh_CN } from 'ng-zorro-antd/i18n';
import { HashLocationStrategy, LocationStrategy, registerLocaleData } from '@angular/common';
//  引入cdk拖曳 模块
import {DragDropModule} from '@angular/cdk/drag-drop';
import zh from '@angular/common/locales/zh';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DragsortComponent } from './dragsort/dragsort.component';
import {NgxEchartsModule} from 'ngx-echarts';
import { ChartsComponent } from './charts/charts.component';
import { VIfDirective } from './directive/v-if.directive';
import { ReactFormComponent } from './react-form/react-form.component';
import { QiankunComponent } from './qiankun/qiankun.component';
// 引入planet
import { NgxPlanetModule} from '@worktile/planet';
import { Compoment1Component } from './compoment1/compoment1.component';
import { SpaComponent } from './spa/spa.component';
import { EmptyComponent } from './empty/empty.component' ;
import { NzMenuModule } from 'ng-zorro-antd/menu';
import {NzLayoutModule} from 'ng-zorro-antd/layout' 
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { TabComponent } from './components/tab/tab.component';
import { TabsComponent } from './components/tab/tabs.component';
import { DemosComponent } from './pages/demos/demos.component';
import { AythSelectorComponent } from './components/ayth-selector/ayth-selector.component';
registerLocaleData(zh);

const httpInterceptorProviders = [
  { provide: HTTP_INTERCEPTORS, useClass: NoopInterceptor, multi: true },
];
@NgModule({
  declarations: [
    AppComponent,
    NavbarComponent,
    SidebarComponent,
    LayoutComponent,
    ContactEditComponent,
    ContactListComponent,
    ContactNewComponent,
    SigninComponent,
    SignupComponent,
    TagNewComponent,
    TagListComponent,
    TagEditComponent,
    HeroFormComponent,
    TableComponent,
    DragsortComponent,
    ChartsComponent,
    VIfDirective,
    ReactFormComponent,
    QiankunComponent,
    Compoment1Component,
    SpaComponent,
    EmptyComponent,
    TabComponent,
    TabsComponent,
    DemosComponent,
    AythSelectorComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    NzTableModule,
    NzResizableModule,
    NzMenuModule,
    NzIconModule,
    NzLayoutModule ,
    NzBreadCrumbModule,
    NgxEchartsModule.forRoot({
      echarts: () => import('echarts')
    }),
    // 不这样写会报错，
    DragDropModule,
    NzSelectModule,
    NgxPlanetModule
  ],
  providers: [
    httpInterceptorProviders,
    { provide: NZ_I18N, useValue: zh_CN },
    {provide: LocationStrategy, useClass: HashLocationStrategy},

    FormBuilder
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
